Method of interrupt control and electronic system using the same

ABSTRACT

A method of interrupt control for a control unit of an electronic system includes receiving digital data; determining a value of the digital data; and sending interrupt signals to a host by the following methods according to the value: when the control unit is in a second signal sending status and after the value of the digital data increases to be greater than a first threshold and remains greater than the first threshold for a first period of time, switching the control unit to a first signal sending status; and when the control unit is in the first signal sending status and after the value of the digital data decreases to be smaller than a second threshold and remains smaller than the second threshold for a second period of time, switching the control unit to the second signal sending status. The second threshold is smaller than the first threshold.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Application No.61/817,306, which was filed on Apr. 29, 2013 and titled “3D-MotionGesture/Proximity Detection Module Sensor (MGPS)”, the contents of whichare incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a method of interrupt control and anelectronic system using the same, and more particularly, to a method ofinterrupt control and an electronic system capable of assisting a hostto receive data.

2. Description of the Prior Art

With advancements in technology, various electronic devices such asmobile phones, GPS navigator systems, tablets, personal digitalassistants (PDA) and laptops have become indispensable in our dailylife. A standard electronic system comprises a core processor such as acentral processing unit (CPU), a microprocessor or a micro control unit(MCU). The core processor is utilized for managing and coordinatingoperations of every device in the electronic system. Since most devicesneed the processor to perform data processing, the load of the processoris heavy. If the processor performance is poor or a large number oftasks suddenly arrive, the processor may not be able to accomplish alltasks in time, resulting in a bottleneck of system performance.

The industry has made a lot of effort to enhance the performance ofelectronic systems by developing more powerful processors as well asreducing their load. If powerful dual-core or quad-core processors areutilized, costs will increase necessarily without a guarantee that theperformance can be doubled or quadrupled. More methods to reduce theprocessor load have therefore been developed, of which one is theinterrupt control method. In the interrupt control method, an interruptsignal is sent to the processor only when there is a task to be executedin a device. Upon receiving the interrupt signal, the processorallocates resources to execute said tasks. In such a situation, theprocessor may not need to keep detecting the operations of every device;instead, the processor only allocates resources to a specific deviceafter receiving the interrupt signal from the device. The load of theprocessor will be significantly reduced. Current methods of sendinginterrupt signals, however, cannot effectively and accurately sendinterrupt signals when a task needs to be executed in the device. Thus,there is a need for improvement over the prior art.

SUMMARY OF THE INVENTION

It is therefore an objective of the present invention to provide amethod of interrupt control and an electronic system using the same,which is capable of controlling an electronic device of the electronicsystem to effectively and accurately send interrupt signals, in order toenhance the efficiency of a processor of the electronic system.

The present invention discloses a method of interrupt control for acontrol unit of an electronic system. The electronic system comprises ahost and an electronic device. The interrupt control method comprisesreceiving digital data generated by the electronic device; determining avalue of the digital data; and sending interrupt signals to the host bythe following methods according to the value of the digital data: whenthe control unit is in a second signal sending status and after thevalue of the digital data increases to be greater than a first thresholdvalue and remains greater than the first threshold value for a firstspecific period of time, the control unit is switched to a first signalsending status; and when the control unit is in the first signal sendingstatus and after the value of the digital data reduces to be smallerthan a second threshold value and remains smaller than the secondthreshold value for a second specific period of time, the control unitis switched to the second signal sending status; wherein the secondthreshold value is smaller than the first threshold value.

The present invention further discloses an electronic system. Theelectronic system comprises a host; an electronic device, for generatingdigital data; and a control unit. The control unit has a programexecuted by a processor for performing a method of interrupt control,wherein the method comprises receiving the digital data generated by theelectronic device; determining a value of the digital data; and sendinginterrupt signals to the host by the following methods according to thevalue of the digital data: when the control unit is in a second signalsending status and after the value of the digital data increases to begreater than a first threshold value and remains greater than the firstthreshold value for a first specific period of time, the control unit isswitched to a first signal sending status; and when the control unit isin the first signal sending status and after the value of the digitaldata reduces to be smaller than a second threshold value and remainssmaller than the second threshold value for a second specific period oftime, the control unit is switched to the second signal sending status;wherein the second threshold value is smaller than the first thresholdvalue.

These and other objectives of the present invention will no doubt becomeobvious to those of ordinary skill in the art after reading thefollowing detailed description of the preferred embodiment that isillustrated in the various figures and drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of a common interrupt signal sendingstatus.

FIG. 2 is a schematic diagram of an electronic system according to anembodiment of the present invention.

FIG. 3 is a schematic diagram of an interrupt signal sending statusaccording to an embodiment of the present invention.

FIG. 4 is a schematic diagram of an interrupt signal sending processaccording to an embodiment of the present invention.

DETAILED DESCRIPTION

As mentioned above, current methods of sending interrupt signals cannoteffectively and accurately send the interrupt signals when a task needsto be executed in the device. Please refer to FIG. 1, which is aschematic diagram of a common interrupt signal sending status. As shownin FIG. 1, a device may determine whether to send interrupt signalsaccording to a value of data. When the value of the data is greater thana threshold value TH, the device may continue to send interrupt signalsto inform the processor to execute the task. When the value of the datais smaller than the threshold value TH, the device may stop sending theinterrupt signals, so the processor does not need to waste resources ondetecting whether there are any tasks to be executed. In this interruptsignal sending policy, when the value of the data is close to thethreshold value TH, noise in the system may cause the device toinaccurately send interrupt signals; alternatively, an interrupt signalneeds to be sent but is not sent due to this noise interference.

Please refer to FIG. 2, which is a schematic diagram of an electronicsystem 20 according to an embodiment of the present invention. Theelectronic system 20 includes a host 202, an electronic device 204, acontrol unit 206, a signal transmission interface 208 and an I/Ointerface 210. The host 202 is utilized for controlling operations ofeach device in the electronic system 20. In general, the host 202 may bea core processor of the electronic system 20 such as a centralprocessing unit (CPU), a microprocessor or a micro control unit (MCU).The electronic device 204, which is a device capable of executingspecific functions, is controlled by the host 202. When the electronicdevice 204 is operating, digital data may be generated, and thesedigital data may be converted into output data to be transmitted to thehost 202 for follow-up processing. The control unit 206 is utilized forreceiving the digital data generated by the electronic device 204 viathe I/O interface 210. The control unit 206 may convert these digitaldata into the output data, which are then transmitted to the host 202via the signal transmitting interface 208. The control unit 206 furthersends the interrupt signals to the host 202 via the I/O interface 210.When the host 202 receives the interrupt signals, the host 202 mayinterrupt ongoing tasks and allocate resources to receive the outputdata.

Please note that the abovementioned signal transmitting interface 208and I/O interface 210 are utilized for performing connections and signaltransmissions between each device. The implementation illustrated inFIG. 2 is only one of various embodiments. For example, the signaltransmitting interface 208 and the I/O interface 210 may be realized inthe electronic system 20 separately. The signal transmitting interface208 and the I/O interface 210 may also be integrated into the controlunit 206, or integrated into the host 202. The electronic system 20 mayalso use a transmission interface to integrate the functions of both thesignal transmitting interface 208 and the I/O interface 210. In otherwords, the control unit 206 may be connected with other devices andsignals may be transmitted via other interfaces or by other methods,which are not limited herein.

In detail, the control unit 206 may have a program 220, which isexecuted by a processor inside the control unit 206, in order to performan interrupt control method. The interrupt control method of the presentinvention can be utilized for controlling the timing of sending theinterrupt signals and preventing the interrupt signals from being sentinaccurately due to noise interference, so that the host 202 canefficiently obtain the output data of the electronic device 204. Thisfurther reduces the load of the host 202 and enhances the efficiency ofthe host 202.

Please refer to FIG. 3, which is a schematic diagram of an interruptsignal sending status according to an embodiment of the presentinvention. As shown in FIG. 3, the control unit 206 defines a firstthreshold value TH1 and a second threshold value TH2, where the secondthreshold value TH2 is smaller than the first threshold value TH1. Thecontrol unit 206 receives digital data D generated by the electronicdevice 204, and determines the value of the digital data D. The controlunit 206 then compares the value of the digital data D with the firstthreshold value TH1 and the second threshold value TH2, in order todetermine whether the control unit 206 is in a first signal sendingstatus or a second signal sending status.

In an embodiment, in the first signal sending status, the control unit206 may continue to send the interrupt signals to the host 202, in orderto notify the host to access the output data corresponding to thedigital data D. In the second signal sending status, the control unit206 may not send the interrupt signals to the host 202, so that the host202 may allocate resources to other devices and does not need to wasteresources on detecting whether there is a task to be processed in theelectronic device 204. Initially, the control unit 206 may be predefinedto be in the second signal sending status and may not send the interruptsignals, as shown in FIG. 3. At this moment, if the value of the digitaldata D is smaller than the first threshold value TH1, the control unit206 is still in the second signal sending status and may not send theinterrupt signals. Even if the digital data D increases to be greaterthan the second threshold value TH2 (e.g. at time T1), the control unit206 will not change its status. When the digital data D increases to begreater than the first threshold value TH1 (e.g. time T2), the controlunit 206 may be switched to the first signal sending status and start tosend the interrupt signals to the host 202. Since the control unit 206starts to send the interrupt signals after the digital data D rises tothe higher first threshold value TH1, it is harder for the digital dataD to trigger the control unit 206 to the first signal sending statuswhen noise causes signal fluctuations, so that inaccurate sending of theinterrupt signals may be reduced.

When the value of the digital data D remains greater than the firstthreshold value TH1, the control unit 206 remains in the first signalsending status and therefore continues to send the interrupt signals tothe host 202. When the value of the digital data D reduces to be smallerthan the first threshold value TH1 (e.g. time T3), the digital data D isstill greater than the second threshold value TH2, so that the controlunit 206 is still in the first signal sending status and continues tosend the interrupt signals. When the digital data D keeps decreasing andfalls to be smaller than the second threshold value TH2 (e.g. time T4),the control unit 206 may be switched to the second signal sending statusand thereby stop sending the interrupt signals to the host 202. Sincethe control unit 206 changes status after the digital data D falls tothe lower second threshold value TH2, it is harder for the digital dataD to trigger the control unit 206 to the second signal sending statuswhen noise causes signal fluctuations, so that the possibility that thecontrol unit 206 has to send the interrupt signals but does not sendthem may be reduced.

The above operations related to the method of sending interrupt signalscan be summarized into an interrupt signal sending process 40, as shownin FIG. 4. The interrupt signal sending process 40, which can becompiled into the program 220 to be executed by the processor in thecontrol unit 206, includes the following steps:

Step 400: Start.

Step 402: Receive the digital data D generated by the electronic device204.

Step 404: Determine whether the control unit 206 is in the second signalsending status. If yes, go to Step 406; otherwise, go to Step 408.

Step 406: Determine whether the value of the digital data D is greaterthan the first threshold value TH1. If yes, go to Step 410; otherwise,go to Step 412.

Step 408: Determine whether the value of the digital data D is smallerthan the second threshold value TH2. If yes, go to Step 412; otherwise,go to Step 410.

Step 410: The control unit 206 is in the first signal sending status andcontinues to send the interrupt signals to the host 202.

Step 412: The control unit 206 is in the second signal sending statusand does not send the interrupt signals to the host 202.

Step 414: End.

In the interrupt signal sending process 40, the determinations ofsending the interrupt signals can be simplified to the followingmethods: when the control unit 206 is in the second signal sendingstatus, only determine whether the value of the digital data D isgreater than the first threshold value TH1. When the value of thedigital data D is determined to be greater than the first thresholdvalue TH1, the control unit 206 is then switched to the first signalsending status. When the control unit 206 is in the first signal sendingstatus, only determine whether the value of the digital data D issmaller than the second threshold value TH2. When the value of thedigital data D is determined to be smaller than the second thresholdvalue TH2, the control unit 206 is then switched to the second signalsending status.

In another embodiment, the control unit 206 is switched to the firstsignal sending status after the value of the digital data D rises to begreater than the first threshold value TH1 and further remains greaterthan the first threshold value TH1 for a period of time, in order toprevent the control unit 206 from inaccurately sending the interruptsignals due to noise interference. The value of the digital data D hasto remain above the first threshold value TH1 for a specific period oftime before the control unit 206 is switched to the first signal sendingstatus and starts to send the interrupt signals to the host 202. Thespecific period of time may be, but should not be limited to, any lengthof time determined according to system requirements. In such asituation, after the value of the digital data D rises and exceeds thefirst threshold value TH1, if the value of the digital data D fallsbelow the first threshold value TH1 within the specific period of time.Such rising and falling may be considered as fluctuations caused bynoise interference, and the control unit 206 may not be triggered tochange status. At this moment, the control unit 206 may still remain inthe second signal sending status and may not send the interrupt signalsto the host 202.

Similarly, the control unit 206 is switched to the second signal sendingstatus after the value of the digital data D falls to be smaller thanthe second threshold value TH2 and remains smaller than the secondthreshold value TH2 for a period of time. The value of the digital dataD has to remain below the second threshold value TH2 for a specificperiod of time before the control unit 206 is switched to the secondsignal sending status and stops sending the interrupt signals to thehost 202. The length of the specific period of time described herein maybe the same as or different from the length of the abovementioned periodfor determining whether to switch the control unit 206 to the firstsignal sending status, which may be determined according to systemrequirements. In such a situation, after the value of the digital data Dfalls to be smaller than the second threshold value TH2, if the value ofthe digital data D returns to be greater than the second threshold valueTH2 within the specific period of time. Such rising and falling may beconsidered as fluctuations caused by noise interference, and the controlunit 206 may not be triggered to change status. At this moment, thecontrol unit 206 may still remain in the first signal sending status andmay keep sending the interrupt signals to the host 202.

Please note that the control unit of the present invention is capable ofaccurately sending the interrupt signals to the host and preventing thenoise interference from causing the interrupt signals to be sentinaccurately. Those skilled in the art can make modifications andalternations accordingly. For example, the magnitudes of the firstthreshold value TH1 and the second threshold value TH2 may be defined tobe a suitable value according to system requirements, which allows thecontrol unit 206 to accurately change status. The electronic device 204may be any devices in the electronic system 20 that can be controlled bythe host 202, which should not be limited to particular types or thosedevices which have particular functions. In other words, any peripheraldevices managed by the host 202 may utilize the abovementioned methodsof sending interrupt signals to prevent noise interference from causingthe signals to be sent inaccurately. Therefore, the host 202 may notneed to keep detecting operations of every device; instead, the host 202may allocate resources to process tasks in the specific device only whenreceiving the interrupt signals.

For example, in an embodiment, the electronic device 204 may be a lightsensor, and the digital data may be related to a sensing result ofambient lights. The host 202 may not need to keep receiving the datasensed by the light sensor; instead, after the light sensor obtains thesensing result, the sensing result is transmitted to the control unit206. The control unit 206 then determines when to start sending theinterrupt signals according to the value of the sensing result, e.g.defining an effective sensing result to be a value greater than thefirst threshold value TH1 and remaining above the first threshold valueTH1 for a period of time. When the effective sensing result is detected,the control unit 206 may start to send the interrupt signals to the host202, in order to notify the host 202 to receive data.

In the above embodiment, in the first signal sending status, the controlunit 206 may continue to send the interrupt signals to the host 202, inorder to notify the host 202 to access the output data corresponding tothe digital data D. In the second signal sending status, the controlunit 206 may not send the interrupt signals to the host 202, so that thehost 202 may allocate resources to other devices, wherein no resourcesare wasted in detecting whether there is a task to be processed in theelectronic device 204. In another embodiment, the control unit 206 maybe controlled to continue to send the interrupt signals to the host 202in the second signal sending status to notify the host 202 to access theoutput data corresponding to the digital data D, while the control unit206 may not send the interrupt signals to the host 202 in the firstsignal sending status, so that the host 202 may allocate resources toother devices. In this way, no resources are wasted in detecting whetherthere is a task to be processed in the electronic device 204.

The methods of switching between the first signal sending status and thesecond signal sending status are still the same as the method shown inFIG. 3, wherein the control unit 206 does not send the interrupt signalsin the first signal sending status and continues to send the interruptsignals to the host 202 in the second signal sending status. Suchsetting of interrupt signal sending may also be incorporated with theabovementioned methods that require a status to be constant for aspecific period of time. For example, if the control unit 206 is in thesecond signal sending status, the control unit 206 may be switched tothe first signal sending status and stop sending the interrupt signalsonly after the value of the digital data D remains above the firstthreshold value TH1 for a specific period of time. If the control unit206 is in the first signal sending status, the control unit 206 may beswitched to the second signal sending status and start to send theinterrupt signals to the host 202 only after the value of the digitaldata D remains below the second threshold value TH2 for a specificperiod of time. As a result, the conditions that the interrupt signalsare sent inaccurately or that the interrupt signals which should be sentbut are not sent due to noise interference may be prevented.

The above signal sending methods switch between two signal sendingstatuses, wherein the interrupt signals are sent continuously in one ofthe statuses and are not sent in the other one. In another embodiment,the methods of sending interrupt signals related to the first signalsending status and the second signal sending status may also beperformed by other methods, which are not limited herein. For example,for a specific type of electronic device, the control unit 206 may notneed to keep sending the interrupt signals; instead, the control unit206 sends an interrupt signal when changing status. In detail, thecontrol unit 206 may send an interrupt signal to the host 202, in orderto notify the host 202 to access the output data corresponding to thedigital data D when the control unit 206 is switched from the secondsignal sending status to the first signal sending status. The controlunit 206 may also send an interrupt signal to the host 202 to notify thehost 202 to access the output data corresponding to the digital data Dwhen switching from the first signal sending status to the second signalsending status. In this embodiment, the methods of switching between thefirst signal sending status and the second signal sending status arestill the same as the method shown in FIG. 3, but the control unit 206only sends an interrupt signal when changing status instead ofcontinuing to send interrupt signals.

Please note that, since the host 202 allocates resources to access theoutput data of the electronic device 204 only when necessary, thesending of the interrupt signals may be adjusted according to differenttypes of electronic devices or different types of output data, whichshould be determined according to system requirements.

In the prior art, conventional methods of sending interrupt signalscannot effectively and accurately send interrupt signals when a taskneeds to be executed in the device. If noise occurs, the noise may causethe device to inaccurately send interrupt signals, or an interruptsignal may need to be sent but is not sent due to the noiseinterference. In comparison, the interrupt control method and electronicsystem of the present invention determines the timing of sendinginterrupt signals by using two threshold values. This is able toeffectively and accurately send the interrupt signals so that efficiencyof the host is enhanced.

Those skilled in the art will readily observe that numerousmodifications and alterations of the device and method may be made whileretaining the teachings of the invention. Accordingly, the abovedisclosure should be construed as limited only by the metes and boundsof the appended claims.

What is claimed is:
 1. A method of interrupt control for a control unitof an electronic system, the electronic system comprising a host and anelectronic device, the interrupt control method comprising: receivingdigital data generated by the electronic device; determining a value ofthe digital data; and sending interrupt signals to the host by one ofthe following methods according to the value of the digital data: whenthe control unit is in a second signal sending status and after thevalue of the digital data increases to be greater than a first thresholdvalue and remains greater than the first threshold value for a firstspecific period of time, switching the control unit to a first signalsending status; and when the control unit is in the first signal sendingstatus and after the value of the digital data reduces to be smallerthan a second threshold value and remains smaller than the secondthreshold value for a second specific period of time, switching thecontrol unit to the second signal sending status; wherein the secondthreshold value is smaller than the first threshold value.
 2. The methodof claim 1, wherein when the control unit is in the first signal sendingstatus, continuing to send the interrupt signals to the host, and whenthe control unit is in the second signal sending status, not sending theinterrupt signals to the host.
 3. The method of claim 1, wherein whenthe control unit is in the first signal sending status, not sending theinterrupt signals to the host, and when the control unit is in thesecond signal sending status, continuing to send the interrupt signalsto the host.
 4. The method of claim 1, wherein when the control unit isswitched from the second signal sending status to the first signalsending status, sending a first interrupt signal to the host, and whenthe control unit is switched from the first signal sending status to thesecond signal sending status, sending a second interrupt signal to thehost.
 5. The method of claim 1, wherein the interrupt signals controlthe host to interrupt an ongoing task in order to allow the host toreceive an output data corresponding to the digital data.
 6. The methodof claim 1, wherein the electronic device is a light sensor, and thedigital data correspond to a sensing result of ambient lights.
 7. Themethod of claim 1, wherein when the control unit is in the first signalsending status, and the value of the digital data reduces to be smallerthan the first threshold value but is greater than the second thresholdvalue, not switching the control unit to the second signal sendingstatus.
 8. The method of claim 1, wherein when the control unit is inthe second signal sending status, and the value of the digital dataincreases to be greater than the second threshold value but is smallerthan the first threshold value, not switching the control unit to thefirst signal sending status.
 9. An electronic system, comprising: ahost; an electronic device, for generating digital data; and a controlunit, having a program executed by a processor for performing a methodof interrupt control, the method comprising: receiving the digital datagenerated by the electronic device; determining a value of the digitaldata; and sending interrupt signals to the host by one of the followingmethods according to the value of the digital data: when the controlunit is in a second signal sending status and after the value of thedigital data increases to be greater than a first threshold value andremains greater than the first threshold value for a first specificperiod of time, switching the control unit to a first signal sendingstatus; and when the control unit is in the first signal sending statusand after the value of the digital data reduces to be smaller than asecond threshold value and remains smaller than the second thresholdvalue for a second specific period of time, switching the control unitto the second signal sending status; wherein the second threshold valueis smaller than the first threshold value.
 10. The electronic system ofclaim 9, wherein when the control unit is in the first signal sendingstatus, the interrupt signals continue to be sent to the host, and whenthe control unit is in the second signal sending status, the interruptsignals are not sent to the host.
 11. The electronic system of claim 9,wherein when the control unit is in the first signal sending status, theinterrupt signals are not sent to the host, and when the control unit isin the second signal sending status, the interrupt signals continue tobe sent to the host.
 12. The electronic system of claim 9, wherein whenthe control unit is switched from the second signal sending status tothe first signal sending status, a first interrupt signal is sent to thehost, and when the control unit is switched from the first signalsending status to the second signal sending status, a second interruptsignal is sent to the host.
 13. The electronic system of claim 9,wherein the interrupt signals control the host to interrupt an ongoingtask in order to allow the host to receive an output data correspondingto the digital data.
 14. The electronic system of claim 9, wherein theelectronic device is a light sensor, and the digital data correspond toa sensing result of ambient lights.
 15. The electronic system of claim9, wherein when the control unit is in the first signal sending status,and the value of the digital data reduces to be smaller than the firstthreshold value but is greater than the second threshold value, thecontrol unit is not switched to the second signal sending status. 16.The electronic system of claim 9, wherein when the control unit is inthe second signal sending status, and the value of the digital dataincreases to be greater than the second threshold value but is smallerthan the first threshold value, the control unit is not switched to thefirst signal sending status.